/* SPDX-License-Identifier: GPL-2.0-or-later */

#include "raminit_tables.h"

/* [CHANNEL][EXT_REVISON][LANE][2*SLOT+RANK][CLOCK_SPEED] */
const u8 u8_FFFD1240[2][5][9][4][4] = {
	{
	 {
	  {
	   {0x3b, 0x53, 0x57, 0x5c},
	   {0x3b, 0x52, 0x57, 0x5c},
	   {0x3b, 0x4d, 0x51, 0x54},
	   {0x3b, 0x4d, 0x51, 0x54}
	   },
	  {
	   {0x46, 0x63, 0x6b, 0x74},
	   {0x46, 0x62, 0x6b, 0x73},
	   {0x46, 0x5d, 0x65, 0x6c},
	   {0x46, 0x5d, 0x65, 0x6c}
	   },
	  {
	   {0x51, 0x71, 0x7e, 0x8a},
	   {0x51, 0x71, 0x7d, 0x8a},
	   {0x51, 0x6c, 0x77, 0x82},
	   {0x51, 0x6c, 0x77, 0x82}
	   },
	  {
	   {0x5c, 0x7b, 0x8a, 0x99},
	   {0x5c, 0x7b, 0x89, 0x98},
	   {0x5c, 0x75, 0x83, 0x90},
	   {0x5c, 0x75, 0x83, 0x90}
	   },
	  {
	   {0x65, 0x81, 0x91, 0xa2},
	   {0x65, 0x81, 0x91, 0xa1},
	   {0x65, 0x7c, 0x8b, 0x9a},
	   {0x65, 0x7c, 0x8b, 0x9a}
	   },
	  {
	   {0x70, 0x8b, 0x9e, 0xb1},
	   {0x70, 0x8b, 0x9d, 0xb0},
	   {0x70, 0x86, 0x97, 0xa9},
	   {0x70, 0x86, 0x97, 0xa9}
	   },
	  {
	   {0x73, 0x8f, 0xa3, 0xb7},
	   {0x73, 0x8f, 0xa3, 0xb6},
	   {0x73, 0x8a, 0x9d, 0xaf},
	   {0x73, 0x8a, 0x9d, 0xaf},
	   },
	  {
	   {0x78, 0x99, 0xaf, 0xc5},
	   {0x78, 0x98, 0xae, 0xc4},
	   {0x78, 0x93, 0xa8, 0xbd},
	   {0x78, 0x93, 0xa8, 0xbd},
	   },
	  {
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94}
	   },
	  },
	 {
	  {
	   {0x3b, 0x53, 0x57, 0x5c},
	   {0x3b, 0x52, 0x57, 0x5c},
	   {0x3b, 0x4d, 0x51, 0x54},
	   {0x3b, 0x4d, 0x51, 0x54}
	   },
	  {
	   {0x46, 0x63, 0x6b, 0x74},
	   {0x46, 0x62, 0x6b, 0x73},
	   {0x46, 0x5d, 0x65, 0x6c},
	   {0x46, 0x5d, 0x65, 0x6c}
	   },
	  {
	   {0x51, 0x71, 0x7e, 0x8a},
	   {0x51, 0x71, 0x7d, 0x8a},
	   {0x51, 0x6c, 0x77, 0x82},
	   {0x51, 0x6c, 0x77, 0x82}
	   },
	  {
	   {0x5c, 0x7b, 0x8a, 0x99},
	   {0x5c, 0x7b, 0x89, 0x98},
	   {0x5c, 0x75, 0x83, 0x90},
	   {0x5c, 0x75, 0x83, 0x90}
	   },
	  {
	   {0x65, 0x81, 0x91, 0xa2},
	   {0x65, 0x81, 0x91, 0xa1},
	   {0x65, 0x7c, 0x8b, 0x9a},
	   {0x65, 0x7c, 0x8b, 0x9a}
	   },
	  {
	   {0x70, 0x8b, 0x9e, 0xb1},
	   {0x70, 0x8b, 0x9d, 0xb0},
	   {0x70, 0x86, 0x97, 0xa9},
	   {0x70, 0x86, 0x97, 0xa9}
	   },
	  {
	   {0x73, 0x8f, 0xa3, 0xb7},
	   {0x73, 0x8f, 0xa3, 0xb6},
	   {0x73, 0x8a, 0x9d, 0xaf},
	   {0x73, 0x8a, 0x9d, 0xaf}
	   },
	  {
	   {0x78, 0x99, 0xaf, 0xc5},
	   {0x78, 0x98, 0xae, 0xc4},
	   {0x78, 0x93, 0xa8, 0xbd},
	   {0x78, 0x93, 0xa8, 0xbd}
	   },
	  {
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94}
	   },
	  },
	 {
	  {
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e}
	   },
	  {
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e}
	   },
	  {
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d}
	   },
	  {
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d}
	   },
	  {
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92}
	   },
	  {
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92}
	   },
	  {
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1}
	   },
	  {
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1}
	   },
	  {
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94}
	   },
	  },
	 {
	  {
	   {0x55, 0x5b, 0x62, 0x61},
	   {0x55, 0x5b, 0x62, 0x61},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e}
	   },
	  {
	   {0x55, 0x5b, 0x62, 0x61},
	   {0x55, 0x5b, 0x62, 0x61},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e}
	   },
	  {
	   {0x5d, 0x67, 0x71, 0x73},
	   {0x5d, 0x67, 0x71, 0x73},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d}
	   },
	  {
	   {0x5d, 0x67, 0x71, 0x73},
	   {0x5d, 0x67, 0x71, 0x73},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d}
	   },
	  {
	   {0x6b, 0x7a, 0x88, 0x8f},
	   {0x6b, 0x7a, 0x88, 0x8f},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92}
	   },
	  {
	   {0x6b, 0x7a, 0x88, 0x8f},
	   {0x6b, 0x7a, 0x88, 0x8f},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92}
	   },
	  {
	   {0x75, 0x87, 0x98, 0xa2},
	   {0x75, 0x87, 0x98, 0xa2},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1}
	   },
	  {
	   {0x75, 0x87, 0x98, 0xa2},
	   {0x75, 0x87, 0x98, 0xa2},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1}
	   },
	  {
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94}
	   },
	  },
	 {
	  {
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e}
	   },
	  {
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e}
	   },
	  {
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d}
	   },
	  {
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d}
	   },
	  {
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92}
	   },
	  {
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92}
	   },
	  {
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1}
	   },
	  {
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1}
	   },
	  {
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94}
	   },
	  },
	 },
	{
	 {
	  {
	   {0x41, 0x59, 0x5f, 0x65},
	   {0x41, 0x59, 0x5f, 0x65},
	   {0x41, 0x53, 0x58, 0x5d},
	   {0x41, 0x53, 0x58, 0x5d}
	   },
	  {
	   {0x4b, 0x69, 0x73, 0x7d},
	   {0x4b, 0x69, 0x73, 0x7d},
	   {0x4b, 0x63, 0x6c, 0x75},
	   {0x4b, 0x63, 0x6c, 0x75},
	   },
	  {
	   {0x54, 0x72, 0x7f, 0x8b},
	   {0x54, 0x72, 0x7f, 0x8b},
	   {0x54, 0x6c, 0x78, 0x83},
	   {0x54, 0x6c, 0x78, 0x83},
	   },
	  {
	   {0x61, 0x81, 0x91, 0xa2},
	   {0x61, 0x81, 0x91, 0xa2},
	   {0x61, 0x7b, 0x8a, 0x99},
	   {0x61, 0x7b, 0x8a, 0x99},
	   },
	  {
	   {0x6a, 0x87, 0x99, 0xab},
	   {0x6a, 0x87, 0x99, 0xab},
	   {0x6a, 0x82, 0x92, 0xa3},
	   {0x6a, 0x82, 0x92, 0xa3},
	   },
	  {
	   {0x71, 0x8b, 0x9e, 0xb1},
	   {0x71, 0x8b, 0x9e, 0xb1},
	   {0x71, 0x86, 0x98, 0xa9},
	   {0x71, 0x86, 0x98, 0xa9},
	   },
	  {
	   {0x75, 0x95, 0xab, 0xc0},
	   {0x75, 0x95, 0xab, 0xc0},
	   {0x75, 0x90, 0xa4, 0xb8},
	   {0x75, 0x90, 0xa4, 0xb8},
	   },
	  {
	   {0x7d, 0x9f, 0xb6, 0xce},
	   {0x7d, 0x9f, 0xb6, 0xce},
	   {0x7d, 0x99, 0xb0, 0xc6},
	   {0x7d, 0x99, 0xb0, 0xc6},
	   },
	  {
	   {0x61, 0x7e, 0x80, 0x9f},
	   {0x61, 0x7e, 0x95, 0x9f},
	   {0x61, 0x7e, 0x80, 0x9f},
	   {0x61, 0x7e, 0x80, 0x9f},
	   },
	  },
	 {
	  {
	   {0x41, 0x59, 0x5f, 0x65},
	   {0x41, 0x59, 0x5f, 0x65},
	   {0x41, 0x53, 0x58, 0x5d},
	   {0x41, 0x53, 0x58, 0x5d},
	   },
	  {
	   {0x4b, 0x69, 0x73, 0x7d},
	   {0x4b, 0x69, 0x73, 0x7d},
	   {0x4b, 0x63, 0x6c, 0x75},
	   {0x4b, 0x63, 0x6c, 0x75},
	   },
	  {
	   {0x54, 0x72, 0x7f, 0x8b},
	   {0x54, 0x72, 0x7f, 0x8b},
	   {0x54, 0x6c, 0x78, 0x83},
	   {0x54, 0x6c, 0x78, 0x83},
	   },
	  {
	   {0x61, 0x81, 0x91, 0xa2},
	   {0x61, 0x81, 0x91, 0xa2},
	   {0x61, 0x7b, 0x8a, 0x99},
	   {0x61, 0x7b, 0x8a, 0x99},
	   },
	  {
	   {0x6a, 0x87, 0x99, 0xab},
	   {0x6a, 0x87, 0x99, 0xab},
	   {0x6a, 0x82, 0x92, 0xa3},
	   {0x6a, 0x82, 0x92, 0xa3},
	   },
	  {
	   {0x71, 0x8b, 0x9e, 0xb1},
	   {0x71, 0x8b, 0x9e, 0xb1},
	   {0x71, 0x86, 0x98, 0xa9},
	   {0x71, 0x86, 0x98, 0xa9},
	   },
	  {
	   {0x75, 0x95, 0xab, 0xc0},
	   {0x75, 0x95, 0xab, 0xc0},
	   {0x75, 0x90, 0xa4, 0xb8},
	   {0x75, 0x90, 0xa4, 0xb8},
	   },
	  {
	   {0x7d, 0x9f, 0xb6, 0xce},
	   {0x7d, 0x9f, 0xb6, 0xce},
	   {0x7d, 0x99, 0xb0, 0xc6},
	   {0x7d, 0x99, 0xb0, 0xc6},
	   },
	  {
	   {0x61, 0x7e, 0x80, 0x9f},
	   {0x61, 0x7e, 0x80, 0x9f},
	   {0x61, 0x7e, 0x80, 0x9f},
	   {0x61, 0x7e, 0x80, 0x9f},
	   },
	  },
	 {
	  {
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   },
	  {
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   },
	  {
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   },
	  {
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   },
	  {
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   },
	  {
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   },
	  {
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   },
	  {
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   },
	  {
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   },
	  },
	 {
	  {
	   {0x56, 0x5d, 0x65, 0x64},
	   {0x56, 0x5d, 0x65, 0x64},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   },
	  {
	   {0x56, 0x5d, 0x65, 0x64},
	   {0x56, 0x5d, 0x65, 0x64},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   },
	  {
	   {0x5e, 0x68, 0x72, 0x74},
	   {0x5e, 0x68, 0x72, 0x74},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   },
	  {
	   {0x5e, 0x68, 0x72, 0x74},
	   {0x5e, 0x68, 0x72, 0x74},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   },
	  {
	   {0x68, 0x76, 0x83, 0x89},
	   {0x68, 0x76, 0x83, 0x89},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   },
	  {
	   {0x68, 0x76, 0x83, 0x89},
	   {0x68, 0x76, 0x83, 0x89},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   },
	  {
	   {0x70, 0x80, 0x90, 0x98},
	   {0x70, 0x80, 0x90, 0x98},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   },
	  {
	   {0x70, 0x80, 0x90, 0x98},
	   {0x70, 0x80, 0x90, 0x98},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   },
	  {
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   },
	  },
	 {
	  {
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   },
	  {
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   {0x57, 0x5e, 0x66, 0x6e},
	   },
	  {
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   },
	  {
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   {0x5e, 0x69, 0x73, 0x7d},
	   },
	  {
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   },
	  {
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   {0x69, 0x77, 0x85, 0x92},
	   },
	  {
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   },
	  {
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   {0x70, 0x80, 0x91, 0xa1},
	   },
	  {
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   {0x5c, 0x79, 0x87, 0x94},
	   }
	  }
	 }
};

const u16 u16_FFFE0EB8[2][4] = {
	{0x0000, 0x0000, 0x0000, 0x0000},
	{0x0000, 0x0000, 0x0000, 0x0000}
};

/* [CARD][LANE][CLOCK_SPEED] */
const u16 u16_ffd1188[2][9][4] = {
	{
	 {0xfff9, 0xfff7, 0xfff5, 0xfff2},
	 {0xfff9, 0xfff7, 0xfff5, 0xfff2},
	 {0xfffb, 0xfff9, 0xfff7, 0xfff6},
	 {0xfffb, 0xfff9, 0xfff7, 0xfff6},
	 {0xfffc, 0xfffb, 0xfffa, 0xfff8},
	 {0xfffc, 0xfffb, 0xfffa, 0xfff8},
	 {0xfffd, 0xfffc, 0xfffb, 0xfffa},
	 {0xfffd, 0xfffc, 0xfffb, 0xfffa},
	 {0x0000, 0x0000, 0x0000, 0x0000}
	 },
	{
	 {0x0001, 0x0001, 0x0001, 0x0002},
	 {0xfffa, 0xfff8, 0xfff6, 0xfff4},
	 {0x0001, 0x0002, 0x0002, 0x0003},
	 {0xffe2, 0xffd8, 0xffce, 0xffc4},
	 {0x0021, 0x002d, 0x0038, 0x0043},
	 {0x0004, 0x0005, 0x0006, 0x0007},
	 {0x000e, 0x0013, 0x0018, 0x001d},
	 {0x0009, 0x000c, 0x000f, 0x0012},
	 {0x0000, 0x0000, 0x0000, 0x0000}
	 }
};

/* [REVISION][CHANNEL][CLOCK_INDEX][?] */
const u8 u8_FFFD1891[2][2][4][12] = {
	{
	 {
	  {0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x08, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00},
	  },
	 {
	  {0x04, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x05, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x07, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x08, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00},
	  }
	 },
	{
	 {
	  {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x0c, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00},
	  },
	 {
	  {0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x08, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x0a, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00},
	  {0x0c, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74}
	  }
	 }
};

const u8 u8_FFFD17E0[2][5][4][4] = {
	{
	 {
	  {0x00, 0x0c, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x23, 0x19, 0x0f, 0x05},
	  {0x23, 0x19, 0x0f, 0x05},
	  },
	 {
	  {0x00, 0x0c, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x23, 0x19, 0x0f, 0x05},
	  {0x23, 0x19, 0x0f, 0x05},
	  },
	 {
	  {0x00, 0x00, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x44, 0x45, 0x47, 0x05},
	  {0x44, 0x45, 0x47, 0x05},
	  },
	 {
	  {0x00, 0x00, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x44, 0x45, 0x46, 0x44},
	  {0x44, 0x45, 0x46, 0x44},
	  },
	 {
	  {0x00, 0x00, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x2a, 0x24, 0x1e, 0x16},
	  {0x2a, 0x24, 0x1e, 0x16},
	  },
	 },
	{
	 {
	  {0x00, 0x08, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x27, 0x1e, 0x16, 0x0d},
	  {0x27, 0x1e, 0x16, 0x0d},
	  },
	 {
	  {0x00, 0x08, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x27, 0x1e, 0x16, 0x0d},
	  {0x27, 0x1e, 0x16, 0x0d},
	  },
	 {
	  {0x00, 0x00, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x44, 0x45, 0x47, 0x05},
	  {0x44, 0x45, 0x47, 0x05},
	  },
	 {
	  {0x00, 0x00, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x43, 0x44, 0x45, 0x43},
	  {0x43, 0x44, 0x45, 0x43},
	  },
	 {
	  {0x00, 0x00, 0x00, 0x00},
	  {0x00, 0x00, 0x00, 0x00},
	  {0x2a, 0x24, 0x1e, 0x16},
	  {0x2a, 0x24, 0x1e, 0x16},
	  },
	 },
};

const u8 u8_FFFD0C78[2][5][4][2][2][4] = {
	{
	 {
	  {
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   },
	  {
	   {
	    {0x00, 0x02, 0x0d, 0x0f},
	    {0x00, 0x02, 0x0d, 0x0f},
	    },
	   {
	    {0x00, 0x02, 0x0d, 0x0f},
	    {0x00, 0x02, 0x0d, 0x0f},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  },
	 {
	  {
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   },
	  {
	   {
	    {0x00, 0x02, 0x0d, 0x0f},
	    {0x00, 0x02, 0x0d, 0x0f},
	    },
	   {
	    {0x00, 0x02, 0x0d, 0x0f},
	    {0x00, 0x02, 0x0d, 0x0f},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  },
	 {
	  {
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   },
	  {
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   },
	  {
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   },
	  {
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   },
	  },
	 {
	  {
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   },
	  {
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   },
	  {
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   },
	  {
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   },
	  },
	 {
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  {
	   {
	    {0x04, 0x06, 0x08, 0x0a},
	    {0x04, 0x06, 0x08, 0x0a},
	    },
	   {
	    {0x04, 0x06, 0x08, 0x0a},
	    {0x04, 0x06, 0x08, 0x0a},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  },
	 },
	{
	 {
	  {
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   },
	  {
	   {
	    {0x00, 0x06, 0x0d, 0x0f},
	    {0x00, 0x06, 0x0d, 0x0f},
	    },
	   {
	    {0x00, 0x06, 0x0d, 0x0f},
	    {0x00, 0x06, 0x0d, 0x0f},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  },
	 {
	  {
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   },
	  {
	   {
	    {0x00, 0x06, 0x13, 0x17},
	    {0x00, 0x06, 0x13, 0x17},
	    },
	   {
	    {0x00, 0x06, 0x13, 0x17},
	    {0x00, 0x06, 0x13, 0x17},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  },
	 {
	  {
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   },
	  {
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   },
	  {
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   },
	  {
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   {
	    {0x04, 0x05, 0x07, 0x08},
	    {0x04, 0x05, 0x07, 0x08},
	    },
	   },
	  },
	 {
	  {
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   },
	  {
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   },
	  {
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   },
	  {
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   {
	    {0x06, 0x07, 0x09, 0x0b},
	    {0x06, 0x07, 0x09, 0x0b},
	    },
	   },
	  },
	 {
	  {
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   {
	    {0x00, 0x00, 0x03, 0x04},
	    {0x00, 0x00, 0x03, 0x04},
	    },
	   },
	  {
	   {
	    {0x04, 0x06, 0x08, 0x0a},
	    {0x00, 0x06, 0x0d, 0x0f},
	    },
	   {
	    {0x00, 0x06, 0x0d, 0x0f},
	    {0x00, 0x06, 0x0d, 0x0f},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  {
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   {
	    {0x00, 0x00, 0x00, 0x00},
	    {0x00, 0x00, 0x00, 0x00},
	    },
	   },
	  },
	 },
};

const u16 u16_fffd0c68[3] = { 0x04c3, 0x064d, 0x068b };

const u16 u16_fffd0c70[2][2] = {
	{0x06c0, 0x06c9},
	{0x06a4, 0x06ad}
};

const u16 u16_fffd0c50[3][2][2] = {
	{
	 {0x04b9, 0x04af},
	 {0x04a5, 0x049b}
	 },
	{
	 {0x0625, 0x062f},
	 {0x0639, 0x0643},
	 },
	{
	 {0x0663, 0x066d},
	 {0x0677, 0x0681}
	 }
};

/* [CLOCK_INDEX] */
const u16 min_cycletime[4] = { 0x09c4, 0x0753, 0x05dc, 0x0000 };

/* [CLOCK_INDEX] */
const u16 min_cas_latency_time[4] = { 0x30d4, 0x2bf2, 0x2904, 0x0000 };

/* [CHANNEL][EXT_SILICON_REVISION][?][CLOCK_INDEX] */
/* On other mobos may also depend on slot and rank.  */
const u8 u8_FFFD0EF8[2][5][4][4] = {
	{
	 {
	  {0x00, 0x00, 0x03, 0x04,},
	  {0x00, 0x02, 0x0d, 0x0f,},
	  {0x00, 0x00, 0x00, 0x00,},
	  {0x00, 0x00, 0x00, 0x00,},
	  },
	 {
	  {0x00, 0x00, 0x03, 0x04,},
	  {0x00, 0x02, 0x0d, 0x0f,},
	  {0x00, 0x00, 0x00, 0x00,},
	  {0x00, 0x00, 0x00, 0x00,},
	  },
	 {
	  {0x09, 0x0c, 0x0f, 0x12,},
	  {0x09, 0x0c, 0x0f, 0x12,},
	  {0x09, 0x0c, 0x0f, 0x12,},
	  {0x09, 0x0c, 0x0f, 0x12,},
	  },
	 {
	  {0x06, 0x08, 0x0a, 0x0c,},
	  {0x06, 0x08, 0x0a, 0x0c,},
	  {0x06, 0x08, 0x0a, 0x0c,},
	  {0x06, 0x08, 0x0a, 0x0c,},
	  },
	 {
	  {0x00, 0x00, 0x00, 0x00,},
	  {0x07, 0x0a, 0x0d, 0x10,},
	  {0x04, 0x06, 0x08, 0x0a,},
	  {0x04, 0x06, 0x08, 0x0a,},
	  },
	 },
	{
	 {
	  {0x00, 0x00, 0x03, 0x04,},
	  {0x00, 0x06, 0x0d, 0x0f,},
	  {0x00, 0x00, 0x00, 0x00,},
	  {0x00, 0x00, 0x00, 0x00,},
	  },
	 {
	  {0x00, 0x00, 0x03, 0x04,},
	  {0x00, 0x06, 0x13, 0x17,},
	  {0x00, 0x00, 0x00, 0x00,},
	  {0x00, 0x00, 0x00, 0x00,},
	  },
	 {
	  {0x09, 0x0c, 0x0f, 0x12,},
	  {0x09, 0x0c, 0x0f, 0x12,},
	  {0x09, 0x0c, 0x0f, 0x12,},
	  {0x09, 0x0c, 0x0f, 0x12,},
	  },
	 {
	  {0x09, 0x0c, 0x10, 0x13,},
	  {0x09, 0x0c, 0x10, 0x13,},
	  {0x09, 0x0c, 0x10, 0x13,},
	  {0x09, 0x0c, 0x10, 0x13,},
	  },
	 {
	  {0x00, 0x00, 0x00, 0x00,},
	  {0x07, 0x0a, 0x0d, 0x10,},
	  {0x04, 0x06, 0x08, 0x0a,},
	  {0x04, 0x06, 0x08, 0x0a,},
	  },
	 },
};

/* [CLOCK_SPEED] */
const u8 u8_FFFD1218[4] = {
	0x15, 0x15, 0x15, 0x12
};

const u8 reg178_min[] = { 1, 3, 4, 7 };
const u8 reg178_max[] = { 62, 60, 59, 56 };
const u8 reg178_step[] = { 5, 4, 3, 2 };

const u16 u16_ffd1178[2][4] = {
	{0xfffb, 0xfffa, 0xfff8, 0xfff7},
	{0xfffb, 0xfffa, 0xfff8, 0xfff7},
};

const u16 u16_fe0eb8[2][4] = {
	{0x0000, 0x0000, 0x0000, 0x0000},
	{0x0000, 0x0000, 0x0000, 0x0000}
};

const u8 lut16[4] = { 14, 13, 14, 14 };
